﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    >

    <ResourceDictionary.MergedDictionaries>
        <!--总颜色样式定义-->
        <ResourceDictionary Source="Colors.xaml"/>
    </ResourceDictionary.MergedDictionaries>

    <!--普通按钮样式-->
    <Style x:Key="BtnStyle" TargetType="{x:Type Button}">
        <Setter Property="FontSize" Value="14"/>
        <Setter Property="Foreground" Value="{StaticResource bg_text}"/>
        <Setter Property="MinHeight" Value="25"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Grid>
                        <Rectangle x:Name="rectangle" Margin="0" StrokeThickness="0" Fill="{StaticResource btn_bg_normal}"/>
                        <ContentPresenter x:Name="contentPresenter" HorizontalAlignment="Center" Margin="0" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsFocused" Value="True"/>
                        <Trigger Property="IsDefaulted" Value="True"/>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Fill" TargetName="rectangle" Value="{StaticResource btn_bg_mouseover}"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter Property="Fill" TargetName="rectangle" Value="{StaticResource btn_bg_pressed}"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Fill" TargetName="rectangle" Value="{StaticResource btn_bg_normal}"/>
                            <Setter Property="OpacityMask" TargetName="contentPresenter" Value="{StaticResource btn_content_enabled}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--冷却计时按钮样式-->
    <Style x:Key="TimerBtnStyle" TargetType="{x:Type Button}">
        <Setter Property="MinHeight" Value="25"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Grid>
                        <Rectangle x:Name="rectangle" Margin="0" StrokeThickness="0" Fill="{StaticResource btn_bg_normal}"/>
                        <ContentPresenter x:Name="contentPresenter" HorizontalAlignment="Center" Margin="0" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <EventTrigger RoutedEvent="Button.Click">
                            <BeginStoryboard>
                                <Storyboard FillBehavior="Stop">
                                    <StringAnimationUsingKeyFrames Storyboard.TargetProperty="(ContentPresenter.Content)" Storyboard.TargetName="contentPresenter">
                                        <DiscreteStringKeyFrame KeyTime="0" Value="已提交"/>
                                        <DiscreteStringKeyFrame KeyTime="0:0:1" Value="等待(30)"/>
                                        <DiscreteStringKeyFrame KeyTime="0:0:2" Value="等待(29)"/>
                                        <DiscreteStringKeyFrame KeyTime="0:0:3" Value="等待(28)"/>
                                        <DiscreteStringKeyFrame KeyTime="0:0:4" Value="等待(27)"/>
                                        <DiscreteStringKeyFrame KeyTime="0:0:5" Value="等待(26)"/>
                                        <DiscreteStringKeyFrame KeyTime="0:0:6" Value="等待(25)"/>
                                        <DiscreteStringKeyFrame KeyTime="0:0:7" Value="等待(24)"/>
                                        <DiscreteStringKeyFrame KeyTime="0:0:8" Value="等待(23)"/>
                                        <DiscreteStringKeyFrame KeyTime="0:0:9" Value="等待(22)"/>
                                        <DiscreteStringKeyFrame KeyTime="0:0:10" Value="等待(21)"/>
                                        <DiscreteStringKeyFrame KeyTime="0:0:11" Value="等待(20)"/>
                                        <DiscreteStringKeyFrame KeyTime="0:0:12" Value="等待(19)"/>
                                        <DiscreteStringKeyFrame KeyTime="0:0:13" Value="等待(18)"/>
                                        <DiscreteStringKeyFrame KeyTime="0:0:14" Value="等待(17)"/>
                                        <DiscreteStringKeyFrame KeyTime="0:0:15" Value="等待(16)"/>
                                        <DiscreteStringKeyFrame KeyTime="0:0:16" Value="等待(15)"/>
                                        <DiscreteStringKeyFrame KeyTime="0:0:17" Value="等待(14)"/>
                                        <DiscreteStringKeyFrame KeyTime="0:0:18" Value="等待(13)"/>
                                        <DiscreteStringKeyFrame KeyTime="0:0:19" Value="等待(12)"/>
                                        <DiscreteStringKeyFrame KeyTime="0:0:20" Value="等待(11)"/>
                                        <DiscreteStringKeyFrame KeyTime="0:0:21" Value="等待(10)"/>
                                        <DiscreteStringKeyFrame KeyTime="0:0:22" Value="等待(09)"/>
                                        <DiscreteStringKeyFrame KeyTime="0:0:23" Value="等待(08)"/>
                                        <DiscreteStringKeyFrame KeyTime="0:0:24" Value="等待(07)"/>
                                        <DiscreteStringKeyFrame KeyTime="0:0:25" Value="等待(06)"/>
                                        <DiscreteStringKeyFrame KeyTime="0:0:26" Value="等待(05)"/>
                                        <DiscreteStringKeyFrame KeyTime="0:0:27" Value="等待(04)"/>
                                        <DiscreteStringKeyFrame KeyTime="0:0:28" Value="等待(03)"/>
                                        <DiscreteStringKeyFrame KeyTime="0:0:29" Value="等待(02)"/>
                                        <DiscreteStringKeyFrame KeyTime="0:0:30" Value="等待(01)"/>
                                        <DiscreteStringKeyFrame KeyTime="0:0:31" Value="等待(00)"/>
                                    </StringAnimationUsingKeyFrames>
                                    <BooleanAnimationUsingKeyFrames Storyboard.TargetProperty="(Button.IsEnabled)">
                                        <DiscreteBooleanKeyFrame KeyTime="0" Value="False"/>
                                        <DiscreteBooleanKeyFrame KeyTime="0:0:32" Value="True"/>
                                    </BooleanAnimationUsingKeyFrames>
                                </Storyboard>
                            </BeginStoryboard>
                        </EventTrigger>
                        <Trigger Property="IsFocused" Value="True"/>
                        <Trigger Property="IsDefaulted" Value="True"/>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Fill" TargetName="rectangle" Value="{StaticResource btn_bg_mouseover}"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter Property="Fill" TargetName="rectangle" Value="{StaticResource btn_bg_pressed}"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Fill" TargetName="rectangle" Value="{StaticResource btn_bg_normal}"/>
                            <Setter Property="OpacityMask" TargetName="contentPresenter" Value="{StaticResource btn_content_enabled}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="FontSize" Value="14"/>
        <Setter Property="Foreground" Value="{StaticResource bg_text}"/>
    </Style>

    <!--系统最小化按钮样式-->
    <Style x:Key="SysMinBtn" TargetType="{x:Type Button}">
        <Setter Property="ToolTip" Value="最小化"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Grid>
                        <Rectangle x:Name="rectangle" StrokeThickness="0" Fill="{StaticResource tilebtn_bg}"/>
                        <Path x:Name="cross" Data="F1 M 19,38L 57,38L 57,44L 19,44L 19,38 Z " Fill="White" 
								Stretch="Fill" Stroke="White" Height="3" Width="12" StrokeThickness="2" HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="0,8"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsFocused" Value="True"/>
                        <Trigger Property="IsDefaulted" Value="True"/>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Fill" TargetName="rectangle" Value="{StaticResource minbtn_mouseover}"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter Property="Fill" TargetName="rectangle" Value="{StaticResource minbtn_pressed}"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False"/>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style> 

</ResourceDictionary>